In a known internal combustion engine having a plurality of cylinders, in which an intake pipe air amount, which is an amount of air existing in an intake pipe from a throttle valve to an intake valve, changes when the intake stroke is executed, it is judged based on a crank angle whether the intake stroke of the i-th cylinder is executed, a change of the intake pipe air amount is calculated when it is judged that the intake stroke of the i-th cylinder is executed, and an in-cylinder charged air amount, which is an amount of air charged in the i-th cylinder, is calculated based on the change of the intake pipe air amount (see Japanese Unexamined Patent Publication No. 2001-234798).
A change of the intake pipe air amount can be calculated, for example, in the form of a difference between the intake pipe air amount at the starting timing of the intake stroke and that at the ending timing of the intake stroke. Specifically, when the crank angle becomes equal to a preset value representing the open-starting timing of the intake valve and stored in advance, the intake pipe air amount at this timing is calculated. When the crank angle becomes equal to another preset value representing the closing timing of the intake valve and stored in advance, the intake pipe air amount at this timing is also calculated. The difference between the intake pipe air amounts is then calculated.
However, if the actual open-starting timing or closing timing of the intake valve deviates from the respective preset value, the intake pipe air amount at the starting or ending timing of the intake stroke can no longer be correctly calculated and the in-cylinder charged air amount cannot be correctly calculated, accordingly.